import {
  createStore
} from 'vuex'

export default createStore({
  state: {
    playList: [{  // 播放列表
      al: {
        id: 74794910,
        name: "CYNDILOVES2SING 爱。心凌",
        pic: 109951163712465490,
        picUrl: "https://p1.music.126.net/zvvxxiwsiKJlXnK9KqBUXg==/109951163712465495.jpg",
        pic_str: "109951163712465495"
      },
      id: 1331593956
    }],
    playListIndex: 0, // 默认下标为0
    isbtnShow: true, // 暂停按钮显示
    detailShow: false, // 歌曲详情页的显示
  },
  mutations: {
    // 点击播放暂停按钮
    updateIsbtnShow(state,value){
      state.isbtnShow = value;
    },
    // 更新播放列表
    updatePlayList(state,value){
      state.playList = value;
    },
    // 更新歌曲index
    updatePlayIndex(state,value){
      state.playListIndex = value;
    },
    // 改变歌曲详情页的显示
    updateDetailShow(state){
      state.detailShow = !state.detailShow
    }
  },
  actions: {},
  modules: {}
})